<?php
/**********************************************************************
 *                                                                    *    
 * Copyright (c) 2009 Dmytro Bezhnar. All rights reserved.     *
 *                                                                    *
 **********************************************************************/

/**
 * Ageset entity manager.
 *
 * @version $Id: IpCoreManager.php,v 1.3 2008/03/13 13:33:46 sdobrovol Exp $
 */
class IpCoreManager extends ORMManager 
{

	public function getCityIp($ip)
	{
		$ip_long = ip2long($ip);
		//$data = $this->getQuery()->from('Ip_IpDBO')->where("ip=$ip_long")->useResultCache(true,$GLOBALS['options']['memcache_core']['get_city_ip_time'])->fetchOne()->toArray();
		if (count($data))
		{
			return array('contry_id'=>$data['country_id'],'state_id'=>$data['state_id'],'city_id'=>$data['city_id']);
		}
		return false;
	}
	
	public function insertIpTemp($ip)
	{
		$ip_long = ip2long($ip);

		$tempIPDBO = new Ip_TempIpDBO();
		$tempIPDBO->ip = $ip_long;
		//$tempIPDBO->save();
	}
}

?>